<template>
  <div class="goods">
      <div class="back" @click="back">返回首页</div>
       <img :src="imgs[id]" alt="">
  </div>
</template>

<script>
export default {
    data:()=>({
        id:'',
        imgs: [require('../../../assets/img1.jpg'),require('../../../assets/img2.jpg'),require('../../../assets/img3.jpg'),require('../../../assets/img4.jpg'),require('../../../assets/img5.jpg'),require('../../../assets/img6.jpg')]
    }),
    created(){
        this.id=this.$route.params.id
    },
    methods:{
        back(){
            this.$router.push('/home')
        }
    }
}
</script>

<style lang="less" scoped>
    .goods{
        .back{
            width: 85px;
            height: 28px;
            background: #fff;
            position: absolute;
            color: #e44c7f;
            line-height: 26px;
            text-align: center;
            right: 0;
            top: 17px;
            font-size: 16px;
        }
        img{
            width: 100%;
        }
    }
</style>
